package net.vz.geoapi.examples;

import net.vz.geoapi.KeywordSearch;
import net.vz.geoapi.MqlSearch;

/**
 * simple test class for geoapi service
 * @author sirrgang
 *
 */
public class MqlSearchTest {

    /**
     * @param args
     */
    public static void main(String[] args) {
        String apiKey = "demo";
        String mqlQuery = "{\"lat\": 37.75629, \"lon\": -122.4213, \"radius\": \"1km\", \"entity\": [{\"type\": \"business\", \"guid\": null}]} ";

        MqlSearch mqlSearch = new MqlSearch(apiKey);
        mqlSearch.setQuery(mqlQuery);
        
        try {
            String response = mqlSearch.doRequest();
            System.out.println(response);
        } catch (Exception _e) {
            _e.printStackTrace();
        }
        
        KeywordSearch keyword;
        
        keyword = new KeywordSearch(apiKey);
        //keyword.setQuery("San Francisco, CA");
        keyword.setQuery("ritual");
        keyword.setEntityGuid("san-francisco-ca");
        keyword.setLimit(10);
        
        try {
            String response = keyword.doRequest();
            System.out.println(response);
        } catch (Exception _e) {
            _e.printStackTrace();
        }
    }

}
